-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[T2135] FIX: Security issue in project - Check domain of presentation video link. #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also consider my suggestions made in the other PR about the FB,Insta links.
parsed_url = urlparse(self.presentation_video) | ||
domain = parsed_url.netloc.lower() | ||
|
||
if not (domain == "youtube.com" or domain.endswith(".youtube.com") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the second test including the first condition. Wouldn't this give the same result (and simplify the code)?
if not (domain == "youtube.com" or domain.endswith(".youtube.com") | |
if not (domain.endswith("youtube.com") |
domain = parsed_url.netloc.lower() | ||
|
||
if not (domain == "youtube.com" or domain.endswith(".youtube.com") | ||
or domain == "vimeo.com" or domain.endswith(".vimeo.com")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or domain == "vimeo.com" or domain.endswith(".vimeo.com")): | |
or domain.endswith("vimeo.com")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, because it would mean that www.avimeo.com/video1 would pass, which is exactly what we want to avoid.
|
No description provided.